package user.blog;

/**
 * This is the flags used to represent the info stored in a blog.
 * 
 * @author cassioafonso@gmail.com
 * 
 */
public enum FlagsPost {
	TITLE("titulo"), DESCRIPTION("descricao"), OWNER("owner"), IDSESSION(
			"idSession"), BLOGID("blogid");

	private String flag;

	/**
	 * This is constructor of this enum, the attributes are statically accessed,
	 * so this for internal use only.
	 * 
	 * @param flag
	 *            The flag used.
	 */
	FlagsPost(String flag) {
		this.flag = flag;
	}

	/**
	 * Provides the {@link String} that represents the flag.
	 * 
	 * @return The flag in a {@link String} format.
	 */
	public String getFlag() {
		return flag;
	}

	/**
	 * This method return all the flags i this enum.
	 * 
	 * @return The flags in a {@link String} format inside the array.
	 */
	public static String[] getFlags() {
		String[] flags = new String[FlagsPost.values().length];
		for (int i = 0; i < flags.length; i++) {
			flags[i] = FlagsPost.values()[i].getFlag();
		}
		return flags;
	}
}